package com.ruoyi.web.controller.wechat;

import com.google.common.collect.Lists;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.domain.Image;
import com.ruoyi.web.controller.wechat.response.PageInfoResponse;
import com.ruoyi.web.controller.wechat.response.TransImageResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * TODO
 *
 * @author chenchuan2
 * @date 2024-12-23 16:48:59
 */
@RestController
@RequestMapping("/wechat-api/page")
@Slf4j
public class PageController {

    @GetMapping("/getLifePayList")
    public R<List<PageInfoResponse>> getLifePayList() {
        List<PageInfoResponse> result = Lists.newArrayList();
        //组装一下这个数据：
        /**
         * {
         * 						name: "话费充值",
         * 						logo: "/static/images/phone_charge.png",
         * 						type: "PHONE",
         * 						url: "/pages/phone/index",
         * 						discount: "88折",
         * 						discountPrefix: "最低"
         *                                        },
         */
//        result.add(new PageInfoResponse("话费充值", "/static/images/phone_charge.png", "PHONE", "/pages/phone/index", "88折", "最低"));

        /**
         * {
         * 						name: "电费充值",
         * 						logo: "/static/images/electric_charge.png",
         * 						type: "ELECTRIC",
         * 						url: "/pages/electric/index",
         * 						discount: "86折",
         * 						discountPrefix: "最低"
         *                                        }
         */
//        result.add(new PageInfoResponse("电费充值", "/static/images/electric_charge.png", "ELECTRIC", "/pages/electric/index", "86折", "最低"));
        return R.ok(result);
    }

    @GetMapping("/test/getLifePayList")
    public R<List<PageInfoResponse>> testGetLifePayList() {
        List<PageInfoResponse> result = Lists.newArrayList();
        //组装一下这个数据：
        /**
         * {
         * 						name: "话费充值",
         * 						logo: "/static/images/phone_charge.png",
         * 						type: "PHONE",
         * 						url: "/pages/phone/index",
         * 						discount: "88折",
         * 						discountPrefix: "最低"
         *                                        },
         */
        result.add(new PageInfoResponse("话费充值", "/static/images/phone_charge.png", "PHONE", "/pages/phone/index", "88折", "最低"));

        /**
         * {
         * 						name: "电费充值",
         * 						logo: "/static/images/electric_charge.png",
         * 						type: "ELECTRIC",
         * 						url: "/pages/electric/index",
         * 						discount: "86折",
         * 						discountPrefix: "最低"
         *                                        }
         */
        result.add(new PageInfoResponse("电费充值", "/static/images/electric_charge.png", "ELECTRIC", "/pages/electric/index", "86折", "最低"));
        return R.ok(result);
    }
}
